<?
if(!defined('INPAGE'))
{
  die("Hacking attempt!");
}

    function xml_to_array($url) {

        $handle = fopen($url, "r");
        
        while (!feof($handle)) {
                $contents .= fread($handle, 81920);
        }
        fclose($handle);
        
        $parser = xml_parser_create();
        xml_parse_into_struct($parser, $contents, $vals, $index);
        xml_parser_free($parser);
        
        
        $i = 0;
        foreach ($vals as $k => $v) {
         
           if (trim($v['value']) != '') {
                   if ($arr[$i][$v['tag']] != '') {
                           $i ++;
                   }
                   $arr[$i][$v['tag']] = $v['value'];
           }
        }       
        
        return($arr);
        
    }
?>